/////////////////////////////////////////////////////////////////////////////
// Name:        nglisp.cpp
// Author:      Nicolay Giraldo
// Created:     15/12/05
// Copyright:   Nicolay Giraldo
/////////////////////////////////////////////////////////////////////////////

#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#  include <wx/wx.h>
#endif

#include <wx/wfstream.h>
#include <wx/txtstrm.h>
#include <wx/splitter.h>
#include <wx/notebook.h>
#include <wx/spinbutt.h>
//#include <wx/richtext/richtextctrl.h>
#include <wx/textctrl.h>
#include <wx/thread.h>
#include <wx/regex.h>
#include <wx/datetime.h>
#include <wx/dynarray.h>
#include <wx/config.h>
//#include <wx/log.h>

#include <tommath.h>

#include "types.h"
#include "interpreter.h"
#include "ide.h"
#include "nglisp.h"


IMPLEMENT_APP(ngLisp)

//int TestApp::OnExit()
//{
//	return 0;
//}

bool ngLisp::OnInit()
{
	SetVendorName(_("MacondoBits"));
	SetAppName(_("ngLisp"));
	
	authorName = wxString(_("© 2006 Nicolay Giraldo"));
	contactInfo = wxString(_("nicolay.giraldo@nglisp.org"));
	
	// this object should be created after setting AppName and VendorName
	// to have the path where to store data in the registry (in windows)
	pConfig = wxConfigBase::Create();
	wxConfigBase::Set(pConfig);
	pConfig->SetRecordDefaults();
	//ResetConfig();
	
	ngLispRuntime = new lispruntime();
	ngLispRuntime->init_common_lisp();
	ide* ideframe = new ide(_("ngLisp"));
	ideframe->Show();
	wxLogColorTextCtrl* logger = new wxLogColorTextCtrl(ideframe->response);
	wxLog::SetActiveTarget(logger);
	return true;
}
